import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopConfigController } from '../../../controllers';
const uctoominishopConfigRouter = new Router();
const minishopConfigController = new uctooMinishopConfigController();

uctoominishopConfigRouter.post('/add', requireUser, minishopConfigController.add);
uctoominishopConfigRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_config'), minishopConfigController.edit);
uctoominishopConfigRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_config'), minishopConfigController.delete);

//For getting minishopConfig with permission control
uctoominishopConfigRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_config'), minishopConfigController.getSingle);
uctoominishopConfigRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_config'), minishopConfigController.getMany);
uctoominishopConfigRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_config'), minishopConfigController.getMany);

//#endregion AutoCreateCode
export default uctoominishopConfigRouter;
